import { reqtradeInfo, reqUserAddressList } from "@/api"

export default {
  state:{
    TradeInfo:{},
    UserAddressList:[]
  },
  mutations:{
    UPDATE_TRADEINFO(state,tradeInfo){
      state.TradeInfo=tradeInfo
    },
    UPDATE_ADDRESSLIST(state,UserAddressList){
      state.UserAddressList=UserAddressList
    }
  },
  actions:{
    async getTradeInfo({commit}){
      let result = await reqtradeInfo()
      if(result.code===200){
        commit('UPDATE_TRADEINFO',result.data)
      }
    },
    async getUserAddressList({commit}){
      let result = await reqUserAddressList()
      if(result.code===200){
        commit('UPDATE_ADDRESSLIST',result.data)
      }
    },
  },
  getters:{
    
  }
}